pixeldungeonfandomcom-20200225-history
User blog:Mdsimmo/How to make images
The very first image I ever uploaded to this wiki was the File:Boomerang.png image. Back then, I didn't know how to get images properly. So, what I did was to grab a camera and take a photo of my device with the boomerang showing. I then took that photo into the Gimp and proceeded to redraw the boomerang - pixel by pixel by pixel - using the eye dropper to guess what colour to draw. Later, the Huntress was added to the game and no-one was uploading an image of her. So again, I got my camera, opened up gimp and proceeded to draw my second image ever. I very quickly learnt two things: # Redrawing images was slow # Guessing what colour the pixels were is very inaccurate There had to be a better way. I tried taking screen shots - it was an improvement but assets often had transparency which made life hard. After much more experimentation and trial and error, I've discovered an easy, quick and accurate method of getting game images. This blog post is a step-by-step of the process I found. ''Note: This process is for getting individual game assets (like items or mobs). For complex images (like inventories) this process will not work'' Get the assets Before doing anything, the first thing you'll have to do is get to the games asset folder (the assets folder is where every game image is stored). There are a couple of ways to do this - some are easier than others but also won't always work. Option 1: Go to Github Pixel Dungeon is open source, so there's a fair chance that the image you want is in the git repository. However, Watabou doesn't upload the source code until after a few weeks. So, this won't work if you're trying to grab new content. But, if it is there, life is easy; # Go to the git repo: https://github.com/watabou/pixel-dungeon # Click the "Download zip" button and extract the download file somewhere # In the extracted file, you'll find the assets directory Option 2: Go to the assets page This wiki has an assets page. It doesn't contain every image, but you might find your image in there. Just download whatever file you want. Option 3: Open up the apk This method uses pixel dungeons apk that is installed on your tablet. The method will always be able to get you the image you want, but is also much more involved. Note: this method does not require root access. Get the apk * Open up some kind of terminal on your device. There's several options - my favourites are: ** adb: A good option for desktops if you already have it installed. ** terminal emulator: A simple terminal application for your tablet. You'll probably also want a more keyboard * In your terminal, run this commands: : grep pixeldungeon}} * You should see something like this appear: package:com.watabou.pixeldungeon * This tells us that the apk's package name is "com.watabou.pixeldungeon". We can then use that name to get the apk's actual file location. Run: : * The returned file path will change from update to update. My terminal looks like this: package:/data/app/com.watabou.pixeldungeon-2/base.apk * The file is protected, so we first need to copy the apk to a location that we can edit it. I'll be copying the file to my "Documents" directory: : Note: the path to '''your' Documents folder may be different to mine'' : : * The apk is now stored in the Documents folder of your device and is easily accessed by any file browser. If you want to use a desktop for the image editing, then you'll need to move the apk to somewhere on your desktop. Open the assets folder Now we have access to the apk, we need to extract the assets folder. This can be done in any half-way decent file browser (or a terminal if you really wanted). I'll be using Windows Explorer. If you're doing this completely from your android tablet, then I'd recommend File Explorer. * Change the apks file extension from .apk file type to .zip * Open the zip file and extract out the assets folder Make your image So far, we've managed to get access to every file in the assets folder. The assets folder contains every image (and sound) in the game. However, they are all compressed into sprite sheets so we'll need to do some image editing to separate them. For this tutorial, I'll be creating File:Chargrilled meat.png - but the procedure is the same for any image. * First, locate where your image is. The Chargrilled meat is stored in the items.png file. * The method of getting the image differs depending on what tool your using. I've split this section into two sections: one for desktops, one for android users. Desktop Users I'll be using Gimp. However, if you're good in another program (eg. Photoshop) then you could use that. Do not use MS Paint as it doesn't support transparency. * Open your file * You'll need a grid to assist you, so go to image → Configure Grid and set the width and height to correctly match the tile sheet. Most assets are 16x16px (but some aren't like the Hero Sprite sheet which is 12x15px). Then press view → show grid * For simple editing (like we're doing in this tut), it's immensely helpful to have your cursor snap to the grid: View → Snap to Grid * Select the rectangle select tool (shortcut: R) and select the the item * Copy the item (ctrl c) * Create a new image from the copied image: File → Create → From Clipboard (shortcut: ctrl shift v) * Make sure that the image is the correct size (most images should be 16x16px) (dimensions are stated in the title bar). If not, then resize the canvas with Image → canvas size and then set the image size to match the canvas size with Layer → Layer to Image Size * It's best to scale the image up for wiki. Press Image → Scale Image and set width and height to appropriate size (48x48px is generally very good). Make sure that Interpolation is set to none * Export the file (File → Export to) to .png format. You must use export, save only creates gimp's .xcf files. * And you're finished! All that's left is to upload your image to the wiki :) Android Users I'll be using Pixly - it has a large amount of features that make it a very nice pixel art editing tool. The one thing it lacks is being able to open multiple images at once. * Open your image * Set up a grid: . Set the width and the height to match the sprite sheet. It will generally be 16x16 but some images are different (e.g. hero sprite sheet is 12x15px). I had to also set the color for the grid to appear (bug?). * Use the rectangle select tool to select your image * Copy the selection: * Create a new image: . Click 'yes' to deleting the old image. * Set the width and the height to the same size as your grid in the promt that appear. * Set the image to have a transparent background: * Paste the selected image: . The image will probably be pasted a long way to the right/down. So zoom out and move the selection to the correct spot. * Generally, you should now make the image 16x16px. . Drag the green lines out/in until the canvas reaches 16x16px. * Scale the image up to be a nice size for the wiki. Generally, 48x48px (300%) is best. . Drag the green lines out until it is the correct size. * Save the image: * You're done! Now all that's left is to upload your image to the wiki :) Category:Blog posts